using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class CM_BillApprovalMap : EntityTypeConfiguration<CM_BillApproval>
    {
        public CM_BillApprovalMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.OENumber)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.PhysicianID)
                .HasMaxLength(6);

            this.Property(t => t.PhysicianName)
                .HasMaxLength(50);

            this.Property(t => t.Type)
                .HasMaxLength(10);

            this.Property(t => t.GuarantorID)
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("CM_BillApproval");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.OENumber).HasColumnName("OENumber");
            this.Property(t => t.ClaimedAmount).HasColumnName("ClaimedAmount");
            this.Property(t => t.ApprovedAmount).HasColumnName("ApprovedAmount");
            this.Property(t => t.PhysicianID).HasColumnName("PhysicianID");
            this.Property(t => t.PhysicianName).HasColumnName("PhysicianName");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.GuarantorID).HasColumnName("GuarantorID");
        }
    }
}
